/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.psi.action.sale;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.psi.mapper.sale.SupplierDetMapper;
public class SupplierDet extends BaseAction
{
    @Autowired(required=false)
	private SupplierDetMapper mapper;
    /**
    供应商信息
    */
    
    public Map supplierDet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        
        SQLList<SQLMap> message=mapper.message(params);
        SQLMap message_emt=message.getExistfirst();
        result.put("message", message_emt);
        
        return result;
    }
    /**
    修改供应商信息
    */
    
    public Map supplierUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> message=mapper.message(params);
        SQLMap message_emt=message.getExistfirst();
        result.put("message", message_emt);
        
        
        SQLList<SQLMap> clienttype=mapper.clienttype(params);
        result.put("clienttype", clienttype);
        
        
        SQLList<SQLMap> clientmode=mapper.clientmode(params);
        result.put("clientmode", clientmode);
        
        
        SQLList<SQLMap> clientorigin=mapper.clientorigin(params);
        result.put("clientorigin", clientorigin);
        
        
        SQLList<SQLMap> s_sort=mapper.s_sort(params);
        result.put("s_sort", s_sort);
        
        
        SQLList<SQLMap> clientbus=mapper.clientbus(params);
        result.put("clientbus", clientbus);
        
        return result;
    }
    /**
    增加电话号码
    */
    
    public Map supplierPhoneAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> phone=mapper.phone(params);
        result.put("phone", phone);
        
        
        SQLList<SQLMap> phonetype=mapper.phonetype(params);
        result.put("phonetype", phonetype);
        
        return result;
    }
    /**
    增加电子邮件
    */
    
    public Map supplierEmailAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> mails=mapper.mails(params);
        result.put("mails", mails);
        
        
        SQLList<SQLMap> emailtype=mapper.emailtype(params);
        result.put("emailtype", emailtype);
        
        return result;
    }
    /**
    修改供应商信息修改
    */
    
    public Map supplierUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.supplierUpSubmit(params);
        
        return result;
    }
    /**
    增加电话号码修改
    */
    
    public Map supplierPhoneAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("phones")){
            params=new SQLParam(request,emt.getMap());
            mapper.ph_id(params);
        }
        
        return result;
    }
    /**
    增加电子邮件修改
    */
    
    public Map supplierEmailAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("email")){
            params=new SQLParam(request,emt.getMap());
            mapper.em_id(params);
        }
        
        return result;
    }
}